Skip to content

Conversation

gosha212
Copy link
Contributor

@gosha212 gosha212 commented Oct 5, 2025

No description provided.

@gosha212 gosha212 changed the title Added missing feature flags React Native 0.78 support Oct 5, 2025
Copy link
Collaborator

@d4vidi d4vidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • code quality should be improved a bit, some changes need to be revisited.
  • We must keep testing for regressions over RN 77, on CI - somehow

expect(tree.toJSON().children).toEqual(['Bob']);

// Re-render to see the updated state
rerender(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisit whether this is indeed necessary

expect(tree.toJSON().children).toEqual(['Bob']);

// Re-render to get updated content
rerender(<MyConnectedComponent renderCountIncrement={renderCountIncrement} />);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revisit whether actually necessary

expect((tree.getInstance() as any)._reactInternalInstance.child.child.Fibernode.key).toEqual(
'component1'
);
// Note: This test is disabled (xit) and uses deprecated React internals
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to replace this with an equivalent expectation?

Comment on lines +175 to +182
const mockComponent = {
props: { componentId: 'doNotUseThisId' },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
componentDidAppear: didAppearFn,
componentWillAppear: jest.fn(),
componentDidDisappear: jest.fn(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mockComponent = {
props: { componentId: 'doNotUseThisId' },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
componentDidAppear: didAppearFn,
componentWillAppear: jest.fn(),
componentDidDisappear: jest.fn(),
};
const mockComponent = aComponent('doNotUseThisId');

return 'Hello';
}
}
// SimpleScreen is no longer used in tests - replaced with mock components
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SimpleScreen is no longer used in tests - replaced with mock components

Comment on lines +154 to +161
const mockComponent = {
props: { componentId: 'test' },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
componentDidAppear: didAppearFn,
componentWillAppear: jest.fn(),
componentDidDisappear: jest.fn(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mockComponent = {
props: { componentId: 'test' },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
componentDidAppear: didAppearFn,
componentWillAppear: jest.fn(),
componentDidDisappear: jest.fn(),
};
const mockComponent = aComponent('test');

Comment on lines +143 to +147
const mockComponent2 = {
props: { componentId: 123 },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mockComponent2 = {
props: { componentId: 123 },
componentDidMount: jest.fn(),
componentWillUnmount: jest.fn(),
};
const mockComponent = aComponent(123);

const tree2 = renderer.create(<SimpleScreen componentId={123} />);
expect(() => uut.bindComponent(tree2.getInstance() as any)).toThrow('');
// Create a mock component instance for testing
const mockComponent = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, why not keep SimpleScreen instead of resorting to mocks here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants